<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>日志列表</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <!--分页样式-->
    <style type="text/css">
        div.green-black{padding:3px;margin:3px;text-align:center;}
        div.green-black a{border:#2c2c2c 1px solid;padding:2px 5px;background:#2c2c2c;color:#fff;margin:0 2px 0 0;text-decoration:none;}
        div.green-black a:hover{border: #23b7e5 1px solid;background: #23b7e5;color:#fff;}
        div.green-black a:active{border: #23b7e5 1px solid;background: #23b7e5;color:#fff;}
        div.green-black span.current{border: #23b7e5 1px solid;padding:2px 5px;font-weight:bold;background:#23b7e5;color:#fff;margin:0 2px 0 0;}
        div.green-black span.disabled{border:#f3f3f3 1px solid;padding:2px 5px;color:#ccc;margin:0 2px 0 0;}
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>日志列表</h5>
                    <a class="btn btn-sm btn-success" style="float: right;margin-bottom: 3px;" href="javascript:location.replace(location.href);" title="刷新" >
                        <i class="fa fa-refresh"></i> </a>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form action="__MODULE__/Admin/Log" method="post">
                            <div class="col-sm-2 m-b-xs">
                                <select name="log_type" class="input-sm form-control input-s-sm inline">
                                    <option value="0">全部</option>
                                    <option value="1" <if condition="$log_type eq 1">selected="selected"</if>>账号信息操作</option>
                                    <option value="2" <if condition="$log_type eq 2">selected="selected"</if>>MT4信息操作</option>
                                    <option value="3" <if condition="$log_type eq 3">selected="selected"</if>>资金变更操作</option>
                                    <option value="4" <if condition="$log_type eq 4">selected="selected"</if>>审核变更操作</option>
                                </select>
                            </div>
                            <div class="col-sm-4 m-b-xs">
                                时间 ： <input type="text" id="from" name="fo" value="{$fo}" class="laydate-icon form-control layer-date" style="width:40%;display:inline-block;"> -
                                <input type="text" id="to" name="to" value="{$to}" class="laydate-icon form-control layer-date" style="width:40%;display:inline-block;">
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input type="text" name="log_user" value="{$log_user}" style="width:200px;" placeholder="管理员邮箱" class="input-sm form-control">
                                    <span class="input-group-btn">
                                    <button type="submit" class="btn btn-w-m btn-info">查询</button>
                                </span>
                                </div>
                            </div>
                        </form>
                        <form method="post" action="__MODULE__/Admin/log_download">
                            <input type="hidden" name="log_type" id="log_type" value="{$log_type}" /><input type="hidden" name="log_user" value="{$log_user}"><input type="hidden" name="fo" value="{$fo}" ><input type="hidden"  name="to" value="{$to}"/>
                                <button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-download">下载已查询数据</i></button>
                        </form>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th></th>
                                <th>ID</th>
                                <th>操作人</th>
                                <th>操作时间</th>
                                <th>操作类型</th>
                                <th>查看详情</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="data" item="data">
                                <tr>
                                    <td><input type="checkbox" class="i-checks" name="input[]"></td>
                                    <td>{$data.log_id}</td>
                                    <td><span class="pie">{$data.log_user}</span></td>
                                    <td>{$data.log_time}</td>
                                    <td>{$data.log_type}</td>
                                    <td>
                                        <a title="查看详情" data-toggle="modal" onclick="log_del(this,'{$data.log_id}');">
                                            <i class="fa fa-search-plus text-navy"></i></a>
                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>

                        <div class="green-black">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="row" id="modal" style="display: none">
    <div class="col-sm-12 b-r">
        <div class="form-group" id="del">
            <textarea type="email_content" id="email_content" style="height: 150px;" disabled class="form-control">{$data.log_content}</textarea>
        </div>
        <div>
            <button class="btn btn-sm btn-primary pull-right m-t-n-xs" id="close" type="button"><strong>关闭</strong>
            </button>
        </div>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->
<script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/common/js/layer_show.js"></script>
<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="__PUBLIC__/admin/js/plugins/layer/laydate/laydate.js"></script>
<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });

        laydate({
            elem: '#from', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
            event: 'focus', /*响应事件。如果没有传入event，则按照默认的click*/
            //format: 'YYYY-MM-DD hh:mm:ss',
        });
        laydate({
            elem: '#to', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
            event: 'focus' /*响应事件。如果没有传入event，则按照默认的click*/
        });
    });
    function log_del(obj,id) {
        if(id==''){
            layer.msg('error404');return;
        }else{
            $.post('__MODULE__/Admin/log_del',{id:id},function (data) {
                if(data.status==1){
                    var str = '<textarea type="email_content" id="email_content" style="height: 280px;" disabled class="form-control">'+data.msg+'</textarea>';

                    $("#del").html(str);
                    var button  = layer.open({
                            title:"操作详情",
                            type: 1,
                            area: ['600px', '400px'],
                            content: $("#modal")
                        }
                    );
                    $("#close").on('click',function () {
                        layer.close(button);
                    })

                }else{
                    layer.msg(data.error);
                }
            })}};

</script>
</body>
</html>
